package com.itc.bi.dto.bigScreen;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;

/**
 * @BelongsProject: itc-airport-cloud
 * @BelongsPackage: com.itc.bi.dto.bigScreen
 * @Author: hecaiy
 * @CreateTime: 2024-07-13  13:38
 * @Description: TODO
 * @Version: 1.0
 */
@Data
@ApiModel(value = "交叉表维度配置")
public class BigCrossTableDimensionDTO implements Serializable{

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(notes = "数据集字段")
    private String columnName;
    private String aliasColumnName;

    @ApiModelProperty(notes = "排序规则,升序:asc 降序:desc,行和列维度使用")
    private String order="asc";

    @ApiModelProperty(notes = "聚合公式  常用7个公式,指标维度使用")
    private String computer;

    @ApiModelProperty(notes = "字段展开状态 0:关闭展开 1:部分打开 2:部分关闭 3:全部展开")
    Integer expanStatus=0;

    public String orderStr(){
        return "`"+columnName+"` "+order;
    }

    public String columnNameStr(){
        return "`"+columnName+"`";
    }
    public String columnAliasNameStr(){
        if(columnName.equals(aliasColumnName)){
            return "`"+columnName+"`";
        }else{
            return "`"+columnName+"` as "+aliasColumnName;
        }
    }
}
